export async function totalVisual(): Promise<goodTotalResponse> {
    try {
      const url = `/api/visual/total`;
      const accessToken = localStorage.getItem('access_token');
      const headers = new Headers();
      headers.append('Authorization', `${accessToken}`);
      headers.append('Content-Type', 'application/json');
      const response = await fetch(url, {
        method: 'GET',
        headers: headers,
      });
  
      // 检查响应是否成功
      if (!response.ok) {
        throw new Error('Network response was not ok');
      }
  
      // 解析响应数据
      const data = await response.json();
      return data;
    } catch (error) {
      console.error('Error fetching goods list:', error);
      throw error;
    }
  }